export class ServiceError extends Error {

  /**
   * 无法找到资源
   */
  static readonly ERROR_CODE_400: number = 400;
  /**
   * 服务器处理异常
   */
  static readonly ERROR_CODE_500: number = 500;

  /**
   * 下载取消
   */
  static readonly ERROR_CODE_CANCELLED: number = 701;


  /**
   * 下载重试超标
   */
  static readonly ERROR_CODE_MAX_RETRIES: number = 1024;

  /**
   * 下载文件分块失败
   */
  static readonly ERROR_CODE_INCOMPLETE: number = 1025;


  constructor(
    public code: any,
    public message: string | undefined,
  ) {
    super(message);
    this.name = 'ServiceError';
  }
}